const state = {
  reporterData: [], // 报案人
  vicitimData: [],  // 受害人
  suspectorData: [], // 嫌疑人
  // ------物件信息-------
  znObjectData: [], // 作案物件
  ssObjectData: [] // 损失物件
}

const mutations = {
  getReporterData (state, data) {
    state.reporterData = data
  },

  getVicitimData (state, data) {
    state.vicitimData = data
  },

  getSuspectorData (state, data) {
    state.suspectorData = data
  },

  getZnObjectData (state, data) {
    state.znObjectData = data
  },

  getSsObjectData (state, data) {
    state.ssObjectData = data
  }
}

const actions = {
  getReporterData ({commit, state}, data) {
    commit('getReporterData', data)
  },

  getVicitimData ({commit, state}, data) {
    commit('getVicitimData', data)
  },

  getSuspectorData ({commit, state}, data) {
    commit('getSuspectorData', data)
  },

  getZnObjectData ({commit, state}, data) {
    commit('getZnObjectData', data)
  },

  getSsObjectData ({commit, state}, data) {
    commit('getSsObjectData', data)
  }
}

const caseStore = {
  namespaced: true, // 给此模块添加命名空间
  state: state,
  mutations: mutations, // 添加了命名空间后 mutation 中的方法可以通过 “模块名/方法” 来获取 如：dispatch('sample/fn')
  actions: actions   // 添加了命名空间,可以通过 “模块名/方法” 来获取 如：commit('sample/fn')
  // getters:getters    // 添加了命名空间,可以通过 “模块名/getter” 来获取 如：getters('sample/getter')
}

export default caseStore
